<?php
/** 
 * @package ShareThisBar Plugin for Joomla! 1.5
 * @subpackage Form Element Stbimagelist
 * @version $Id: sharethisbar.php 3.5 2012-12-29 17:00:33Z Dusanka $
 * @author Dusanka Ilic
 * @copyright (C) 2012 - Dusanka Ilic, All rights reserved.
 * @authorEmail: gog27.mail@gmail.com
 * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html, see LICENSE.txt
**/

defined('JPATH_BASE') or die();

/**
 * Supports an HTML select list of images, which start with a word "spread",
 * from directory /sharethisbar/images
 *
 * @package     ShareThisBar
 * @since       3.5
 */

class JElementStbImageList extends JElement
{

	/**
	 * The element name.
	 */
        var $_name = 'StbImageList';

        function fetchElement($name, $value, &$node, $control_name)       
	{
		// Define the image file type filter.
		// $filter = '\.png$|\.gif$|\.jpg$|\.bmp$|\.ico$';
            
                // Select only pictures that start with word spread-
                $filter = '^spread(.)*[\.png|\.gif|\.jpg|\.jpeg]$';

                $node->addAttribute('filter', $filter);
                
                $parameter =& $this->_parent->loadElement('filelist');

                return $parameter->fetchElement($name, $value, $node, $control_name);
                
                
	}
}
